package com.lzy.concertticket.handler;

import com.lzy.concertticket.model.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(RuntimeException.class)
    public R handleException(Exception e) {
        log.error("全局异常捕获：", e);
        return R.fail(e.getMessage());
    }

}
